<%@ page import="com.menu.*" %>
<%@ page import="java.util.*" %>

<html>
<head>
<meta http-equiv=content-type content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="../menu/leftmenu/leftmenu.css" id="menuStyleSheet">
<script type="text/javascript">
<!--

//点击页面菜单隐藏
document.onclick = function()
{
    if(window.top.hideAllMenuScriptlets)
    {
        window.top.hideAllMenuScriptlets();
    }
}
//-->
</script>
</head>

<%
 MenuGenerator mg = new MenuGenerator();
 List menus = mg.getMenuList();
 Iterator menusIter=menus.iterator();
%>

<body  bgcolor="#E3F1FD" leftMargin="0" topMargin="0" marginwidth="0" marginheight="0" id="outlookbody"  scroll=no  onload="if(parent.folder != -1 && bResize==true){OutlookLikeBar.FolderClicked(parent.folder);bResize=false;}lastHeight = document.body.clientHeight;">
<script language="javascript">
<%
    int menuIndex=0;
	int index= 0 ;
    String initinfo = "";
    while(menusIter.hasNext())
    {
        menuIndex++;
        MenuItem menuItem=(MenuItem) menusIter.next();
        String menuInfo="OutBarFolder"+menuIndex+"=new Array(\""+menuItem.getName()+"\"";
        List childItems=menuItem.getChildMenuItems();
        Iterator childIter=childItems.iterator();
        while(childIter.hasNext())
        {
			index++;
            ChildMenuItem childItem=(ChildMenuItem) childIter.next();
            menuInfo+=",\""+childItem.getImg()+"\",\""+new String(childItem.getName())+"\",\""+childItem.getHref();
			if(menuIndex==1 && index==1)
				initinfo=childItem.getHref();
            Map paramMap=childItem.getProps();
            Set keySet=paramMap.keySet();
            Iterator keyIter=keySet.iterator();
            if(keyIter.hasNext())
            {
                String firstKey=(String) keyIter.next();
                String firstValue=(String)paramMap.get(firstKey);
                menuInfo+="?"+firstKey+"="+firstValue;
                if(menuIndex==1 && index==1)
				   initinfo+="?"+firstKey+"="+firstValue;
			}
            while(keyIter.hasNext())
            {
                String key=(String) keyIter.next();
                String value=(String) paramMap.get(key);
                menuInfo+="&amp;"+key+"="+value;
				if(menuIndex==1 && index==1)
                   initinfo+="&amp;"+key+"="+value;
            }

            menuInfo+="\",\""+childItem.getTarget()+"\"";
        }
        menuInfo+=");";
        out.println(menuInfo);
    }
%>

var path='../menu/leftmenu/';
var OB_UpArrow=path+'arrowdown.gif';	//向上滚动的向下logo箭头
var OB_DownArrow=path+'arrowup.gif';	//向下滚动的向上logo箭头
var bButtonClick=false;
if (document.all)
{
	document.write('<script src="../menu/leftmenu/outbar.js"><\/script>')
}

function noright()
{
	if (event.button == 2 | event.button == 3)
	{
	    alert("");
	}
}

var bLoad=true;
window.onresize = window_OnResize;
var lastHeight;
var bResize = false;
function window_OnResize()
{
	if(document.body.clientHeight != lastHeight)
	{
	    lastHeight = document.body.clientHeight;
	    bResize = true;
	    location.reload();
	}
}
parent.mainFrm.location="<%=initinfo%>";

</script>
</body>
</html>
